<template>
    <div>
        展示分类信息
        <ul>
            <li v-for="i in data" @click="setcid(i.id)" :class="i.id==cid?'active':''">{{i.name}}</li>
        </ul>
    </div>
</template>

<script>
    export default {
        props:['data','cid'],
        data(){
            return{
                
            }
        },
       
        methods:{
            setcid(cid){
                this.cid=cid
                //课程修改时子组件向父组件传递修改的新cid
                this.$emit('cid',cid)
            },
        },
        mounted(){},

        
    }
</script>

<style scoped>
.active{
    background:blueviolet;
}
</style>